// element css
import 'element-plus/dist/index.css'
// element dark css
import 'element-plus/theme-chalk/dark/css-vars.css'
// custom element dark css
import '@/styles/element-dark.scss'
// custom element css
import '@/styles/element.scss'
// element plus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// element icons
import * as Icons from '@element-plus/icons-vue'
import type { App } from 'vue'

export function setupElement(app: App) {
  // register the element Icons component
  Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key as keyof typeof Icons])
  })

  app.use(ElementPlus, {
    locale: zhCn,
  })

  return app
}
